﻿<%@ Page Title="" Language="C#" MasterPageFile="~/backend/Admin.Master" AutoEventWireup="true" CodeBehind="TeacherList.aspx.cs" Inherits="mamnontuoitho7.backend.TeacherList" %>
<%@ Import Namespace="mamnontuoitho7.AppCode" %>

<asp:Content ID="Content1" ContentPlaceHolderID="AdminTitleContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<!-- Begin one column tab content window -->
    <div class="onecolumn">
	    <div class="header">
		    <span>Danh Sách Tài Khoản Giáo Viên</span>
		    <div class="switchbutton">
                  <a href="TeacherCreate.aspx" class="buttons stylebutton">Thêm giáo viên mới</a>
		    </div>
	    </div>
	    <br class="clear"/>
	    <div class="content">
		    <div id="tab1_content" class="tab_content">


			    <table width="100%">
                    <tr>
                        <td>
                            <!--<div id="content">-->
                            <div id="tablewrapper">
                                <div id="tableheader">
                                    <div class="search">
                                        <select id="columns" onchange="sorter.search('query')">
                                        </select>
                                        <input type="text" id="query" onkeyup="sorter.search('query')" />
                                    </div>
                                    <div class="details">
                                        <div class="ddl">
                                            <!--Vị trí đặt loại item-->
                                            <form id="formddl" runat="server">
                                            <asp:DropDownList ID="ddlShowTeacher" runat="server" Style="width: 200px;" 
                                                AutoPostBack="True" 
                                                onselectedindexchanged="ddlShowTeacher_SelectedIndexChanged">
                                                <%--<asp:ListItem Value="-1">Xem hết</asp:ListItem>--%>
                                                <asp:ListItem Value="1">Giáo viên đang làm việc</asp:ListItem>
                                                <asp:ListItem Value="0">Giáo viên đã nghỉ việc</asp:ListItem>
                                            </asp:DropDownList>
                                            </form>
                                        </div>
                                        <div>
                                            <asp:Label ID="Label20" runat="server" Text='Kết quả' />
                                            <span id="startrecord"></span>-<span id="endrecord"></span>
                                            <asp:Label ID="Label21" runat="server" Text='của' />
                                            <span id="totalrecords"></span>
                                        </div>
                                        <div>
                                            <a href="javascript:sorter.reset()">
                                                <asp:Label ID="Label23" runat="server" Text='Thiết lập lại' /></a></div>
                                    </div>
                                </div>

                                 <%
        /* Check class has teacher or not */
                                     if (_dttTeacher.Rows.Count > 0)
                                     {%>

                                <table cellpadding="0" cellspacing="0" border="0" id="table" class="tinytable">
                                    <thead>
                                        <tr>
                                            <!--vị trí header list-->
                                            <th>
                                                <h3>
                                                    <asp:Label ID="Label4" runat="server" Text='Mã số'></asp:Label>
                                                </h3>
                                            </th>
                                            <th>
                                                <h3>
                                                    <asp:Label ID="Label3" runat="server" Text='Hình Ảnh'></asp:Label>
                                                </h3>
                                            </th>
                                            <th>
                                                <h3>
                                                    <asp:Label ID="Label5" runat="server" Text='Tên Giáo Viên'></asp:Label>
                                                </h3>
                                            </th>
                                            <th>
                                                <h3>
                                                    <asp:Label ID="Label1" runat="server" Text='Ngày sinh'></asp:Label>
                                                </h3>
                                            </th>
                                            <th>
                                                <h3>
                                                    <asp:Label ID="Label2" runat="server" Text='Dạy Lớp'></asp:Label>
                                                </h3>
                                            </th>
                                            <th class="nosort" style="text-align: center;">
                                                <h3>
                                                    <asp:Label ID="Label90" runat="server" Text='Tình trạng'></asp:Label>
                                                </h3>
                                            </th>
                                            <th class="nosort" style="text-align: center;">
                                                <h3>
                                                    <asp:Label ID="Label91" runat="server" Text='Sửa' /></h3>
                                            </th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                         <% for (int i = 0; i < _dttTeacher.Rows.Count; i++)
                                            {
                                        %>
                                        <tr>
                                            <td style="text-align: center; width:60px;">
                                                <%= _dttTeacher.Rows[i]["MemberID"].ToString()%>
                                            </td>
                                            <td style="text-align: center; width:90px;">
                                                <img src="../images/avatar/teacher_parents/<%= _dttTeacher.Rows[i]["Avatar"].ToString() != "" ? _dttTeacher.Rows[i]["Avatar"].ToString() : ConstantClass._memberDefaultAvatar %>" alt="" class="img60x80"/>
                                            </td>
                                            <td>
                                                <%= _dttTeacher.Rows[i]["FullName"].ToString()%>
                                           </td>
                                           <td style="text-align: center; width:80px;">
                                                <%= _dttTeacher.Rows[i]["Birthday"].ToString()%>
                                           </td>
                                           <td style="text-align: center;">
                                                <%= _dttTeacher.Rows[i]["ClassName"].ToString()%>
                                           </td>
                                            <td style="text-align: center; width:60px;">
                                                <%if (_dttTeacher.Rows[i]["MemberVisible"].ToString().ToLower().Equals("true"))
                                                  { %>
                                                    <form method="post" action="TeacherList.aspx">
                                                       <input type="hidden" id="hidden1" name="hidTeacherVisible" value="<%=_dttTeacher.Rows[i]["MemberVisible"].ToString().ToLower()%>" />
                                                       <input type="hidden" id="hidden2" name="hidTeacherID" value="<%=_dttTeacher.Rows[i]["MemberID"].ToString() %>" />
                                                       <button type="submit" title="Xét nghĩ việc" onclick="javascript: if (confirm('Bạn muốn cập nhật giáo viên <%=_dttTeacher.Rows[i]["FullName"].ToString() %> đã nghỉ?')) { window.location.href='#' } else { return false; };">
                                                            <img alt="Đang làm việc" src="layout/table/images/activation.png" />
                                                       </button>
                                                    </form>
                                               <% }
                                                 else
                                                 { %>
                                                    <form method="post" action="TeacherList.aspx">
                                                           <input type="hidden" id="hidden3" name="hidTeacherVisible" value="<%=_dttTeacher.Rows[i]["MemberVisible"].ToString().ToLower()%>" />
                                                           <input type="hidden" id="hidden4" name="hidTeacherID" value="<%=_dttTeacher.Rows[i]["MemberID"].ToString() %>" />
                                                       <button type="submit" title="Xét làm việc lại" onclick="javascript: if (confirm('Bạn muốn cập nhật giáo viên <%=_dttTeacher.Rows[i]["FullName"].ToString() %> còn đang làm?')) { window.location.href='#' } else { return false; };">
                                                            <img alt="Đã nghỉ việc" src="layout/table/images/inactivation.png" />
                                                       </button>
                                                    </form>
                                               <% } %>
                                            </td>
                                            <td style="text-align: center; width:60px;">
                                                <form method="get" action="TeacherEdit.aspx">
                                                    <input type="hidden" id="hidden7" name="hidTeacherID" value="<%= _dttTeacher.Rows[i]["MemberID"].ToString() %>" />
                                                    <input type="hidden" id="hidden8" name="hidNamePage" value="TeacherList.aspx" />
                                                    <button type="submit" title="Chỉnh sửa thông tin giáo viên">
                                                        <img alt="" src="layout/table/images/grid_edit.png" />
                                                    </button>
                                                </form>
                                            </td>
                                        </tr>
                                          <% }
                                     }%>
                                    </tbody>
                                </table>
                                <div id="tablefooter">
                                    <div id="tablenav">
                                        <div>
                                            <img src="layout/table/images/first.gif" alt=""/>
                                            <img src="layout/table/images/first.gif" width="16" height="16" alt="First Page"
                                                onclick="sorter.move(-1,true)" />
                                            <img src="layout/table/images/previous.gif" width="16" height="16" alt="First Page"
                                                onclick="sorter.move(-1)" />
                                            <img src="layout/table/images/next.gif" width="16" height="16" alt="First Page" onclick="sorter.move(1)" />
                                            <img src="layout/table/images/last.gif" width="16" height="16" alt="Last Page" onclick="sorter.move(1,true)" />
                                        </div>
                                        <div>
                                            <select id="pagedropdown">
                                            </select>
                                        </div>
                                        <div>
                                            <a href="javascript:sorter.showall()">
                                                <asp:Label ID="Label25" runat="server" Text='Xem tất cả' /></a>
                                        </div>
                                    </div>
                                    <div id="tablelocation">
                                        <div>
                                            <select onchange="sorter.size(this.value)">
                                                <option value="5">5</option>
                                                <option value="10" selected="selected">10</option>
                                                <option value="20">20</option>
                                                <option value="50">50</option>
                                                <option value="100">100</option>
                                            </select>
                                            <span>
                                                <asp:Label ID="Label24" runat="server" Text='Kết quả mỗi trang' /></span>
                                        </div>
                                        <div class="page">
                                            <asp:Label ID="Label55" runat="server" Text='Trang' />
                                            <span id="currentpage"></span>
                                            <asp:Label ID="Label26" runat="server" Text='của' />
                                            <span id="totalpages"></span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <script type="text/javascript" src="layout/table/2.js"></script> <!--vị trí có tham số không sort trên grid đếm từ phải qua trái-->
                            <script type="text/javascript">
                                var sorter = new TINY.table.sorter('sorter', 'table', {
                                    headclass: 'head',
                                    ascclass: 'asc',
                                    descclass: 'desc',
                                    evenclass: 'evenrow',
                                    oddclass: 'oddrow',
                                    evenselclass: 'evenselected',
                                    oddselclass: 'oddselected',
                                    paginate: true,
                                    size: 10,
                                    colddid: 'columns',
                                    currentid: 'currentpage',
                                    totalid: 'totalpages',
                                    startingrecid: 'startrecord',
                                    endingrecid: 'endrecord',
                                    totalrecid: 'totalrecords',
                                    hoverid: 'selectedrow',
                                    pageddid: 'pagedropdown',
                                    navid: 'tablenav',
                                    /*
                                    sortcolumn: 0,
                                    sortdir: -1,
                                    sum:[8],
                                    avg:[6,7,8,9],
                                    columns:[{index:7, format:'%', decimals:1},{index:8, format:'$', decimals:0}], */
                                    init: true
                                });
                            </script>
                            <!--</div>-->
                        </td>
                    </tr>
                </table>


            </div>
        </div>
    </div>
<!-- End one column tab content window -->
</asp:Content>
